If Right$(UCase$(TxtFrmName.Text), 4) <> ".FRM" Then
TxtFrmName.Text = TxtFrmName.Text & ".FRM"
End If
sForm = TxtFrmName.Text
If stemplate = "" Then
Beep
mousepointer = DEFAULT
MsgBox "You must specify a form template or use the file drawer button to locate a form template.", 0 + 48 + 0 + 0, "Form Template Error"
TxtTmpltName.SetFocus
Exit Sub
End If
If Dir$(stemplate) = "" Then
Beep
mousepointer = DEFAULT
MsgBox "The form template you have specified does not exist! Use the file drawer button to locate a form template.", 0 + 48 + 0 + 0, "Form Template Error"
TxtTmpltName.SetFocus
Exit Sub
End If
If sForm = "" Then
Beep
mousepointer = DEFAULT
MsgBox "You must specify a form name or use the file drawer button to locate a form.", 0 + 48 + 0 + 0, "Form Save Error"
TxtFrmName.SetFocus
Exit Sub
End If
If sForm = stemplate Then
Beep
mousepointer = DEFAULT
MsgBox "You cannot use the template as the output form.", 0 + 48 + 0 + 0, "Form Save Error"
TxtFrmName.SetFocus
Exit Sub
End If
On Error GoTo erropeningtemplate
Open stemplate For Input Access Read Lock Write As #1
On Error GoTo erropeningform
Open sForm For Output Access Write Lock Read Write As #2
On Error GoTo GenerateErr
indent = 0
Do While Not EOF(1)
Input #1, sFormLine
Select Case True
Case InStr(1, sFormLine, "Begin Form", 1) <> 0 ' Beginning of form
Print #2, "Begin Form " & CaptnFrm.TxtName.Text
indent = 3
Case InStr(1, sFormLine, "Caption", 1) <> 0 ' Form Caption line